#include "atomic_0824_inertial_resistance_data_service.h"

int getInertialData(InertialInput *inertialInput, InertialOutput *inertialOutput) {
    // 检查输入输出指针是否为空
    if (inertialInput == nullptr || inertialOutput == nullptr) {
        return ATOMIC_SERVICE_ERROR;
    }
    
    // 模拟惯阻数据计算（实际场景应根据传感器数据计算）
    if (inertialInput->is_calibrated) {
        inertialOutput->inertia_x = 0.5f + inertialInput->sensor_id * 0.1f;
        inertialOutput->inertia_y = 0.3f + inertialInput->sensor_id * 0.05f;
        inertialOutput->resistance = 2.5f + inertialInput->sample_frequency * 0.02f;
    } else {
        inertialOutput->inertia_x = 0.0f;
        inertialOutput->inertia_y = 0.0f;
        inertialOutput->resistance = 0.0f;
        return ATOMIC_SERVICE_NOT_SUPPORT; // 假设已定义未校准状态码
    }
    
    return ATOMIC_SERVICE_SUCCESS;
}
